package com.gary.provider;

import com.gary.entity.MyURL;
import com.gary.registry.NativeRegistry;
import com.gary.service.ITicketService;
import com.gary.service.impl.TicketServiceImpl;
import com.gary.tomcat.HttpServer;

/**
 * 真正的注册服务
 * @author pengrui3
 * @date 2020/12/11-21:48
 */
public class ServiceProvider {
    public static void main(String[] args) {
        //注册服务
        MyURL myURL = new MyURL("localhost",8080);
        NativeRegistry.registry(ITicketService.class.getName(), myURL, TicketServiceImpl.class);

        //暴露服务
        HttpServer httpServer = new HttpServer();
        httpServer.start(myURL.getHostAddress(), myURL.getPort());
    }
}
